<template>
	<view class="content">
		<headerbox :cixitype="cixi"></headerbox>
		<view class="pages">
			<view class="card">
				<view class="card-body">
					<view class="title">
						<view>我的团队</view>
						<view class="btn" @click="goSwichPage('/pages/menu/my_team_addnew')">开户</view>
					</view>
					<view class="bodys">
						<view class="bodystitle">
							团队总人数(活跃) {{list.length}}(
							<text style="color: green"> {{list.length}}</text>
							)
						</view>
					</view>
					
					<view class="" style="padding: 20rpx;font-size: 22rpx;">
						<view class="" style="display: flex;align-items: center;justify-content: space-between;">
							             
						
							<view class="" style="width: 20%;">ID</view>
							<view class="" style="width: 20%;">账号</view>
							<view class="" style="width: 20%;">受保次数</view>
							<view class="" style="width: 20%;">受保总金额</view>
							<view class="" style="width: 30%;">团队总受保金额</view>
						</view>
						<view class="contentTow" v-for="(item,index) in list" :key="index" style="display: flex;align-items: center;justify-content: space-between;padding: 20rpx 0;">
							<view class="pb-0" style="width: 20%;">{{item.id}}</view>
							<view class="pb-0" style="width: 20%;">{{item.name}}</view>
							<view class="pb-0" style="width: 20%;">{{item.num}}</view>
							<view class="pb-0" style="width: 20%;">{{item.money}}</view>
							<view class="pb-0" style="width: 20%;">{{item.team_money}}</view>
						</view>
					</view>
				
				</view>
			</view>
		</view>
		<view class="footer-bar" :class="cixi ? '':'footer-bar-detached'">
			<view class="fbitem" @click="goSwichPage('/pages/index/index')">
				<view class="image">
					<image src="../../static/timg/shouye.png" mode=""></image>
				</view>
				<view class="text">首页</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/contract/contract')">
				<view class="image">
					<image src="../../static/timg/heyue.png" mode=""></image>
				</view>
				<view class="text">合约</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/assets')">
				<view class="image">
					<image src="../../static/timg/zichan.png" mode=""></image>
				</view>
				<view class="text">资产</view>
			</view>
			<view class="fbitem" @click="goSwichPage('/pages/user/claim')">
				<view class="image">
					<image src="../../static/timg/suopei.png" mode=""></image>
				</view>
				<view class="text">索赔</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { bx_member_offline } from '../../api/api.js'
	import headerbox from '@/pages/header.vue'
	export default{
		components:{
			headerbox
		},
		data(){
			return{
				cixi:false,
				list:[]
			}
		},
		onShow() {
			this.init()
		},
		onPageScroll(e) {
			if(e.scrollTop > 0){
				this.cixi = true
			}else{
				this.cixi = false
			}
		},
		methods:{
			init(){
				let datas = {
					page:1,
				}
				bx_member_offline(datas).then(res => {
					console.log(res,'res---')
					if(res.data.status.errorCode == 0){
						this.list = res.data.data.data.data
					}
				}).catch(err => {
					console.log(err)
				})
			},
			copy(value) {
				uni.setClipboardData({
					data: value,
					success: function() {
						//调用方法成功
						uni.showToast({
							title: '复制成功',
							icon: 'success',
							duration: 2000
						});
					}
				})
			},
			goSwichPage(page){
				uni.navigateTo({
					url:page
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	*{
		box-sizing: border-box;
	}
	.content{
		width: 100%;
		min-height: 100vh;
		background-color: #f1f1f7;
		color: #747474 !important;
	}
	.pages{
		padding-top: calc(calc(110rpx + 60rpx) + env(safe-area-inset-top));
		padding-bottom: calc(120rpx + env(safe-area-inset-bottom));
	}
	.card{
		width: 94%;
		margin: 0 auto;
		border-radius: 20rpx;
		position: relative;
		display: flex;
		flex-direction: column;
		word-wrap: break-word;
		margin-bottom: 30rpx;
		overflow: hidden;
		background-color: #fff;
		box-shadow: rgba(0, 0, 0, .35) 0px 30px 60px -30px, rgba(0, 0, 0, .35) 0px -2px 6px 0px inset;
	}
	.card-body{
		z-index: 3;
		flex: 1 1 auto;
	}
	.title{
		width: 100%;
		padding: 20rpx 40rpx;
		background-color: rgba(0, 0, 0, 0.03);
		border-bottom: 2rpx solid rgba(0, 0, 0, 0.125);
		font-size: 32rpx;
		line-height: 44rpx;
		font-weight: 700;
		color: #1b1b1b;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.title .btn{
		font-size: 22rpx;
		padding: 12rpx 26rpx;
		font-weight: 700;
		border-radius: 24rpx;
		box-shadow: 0 10rpx 28rpx 0 rgba(0, 0, 0, 0.1);
		line-height: 1.5;
		background-image: linear-gradient(to bottom, #5D9CEC, #4A89DC) !important;
		color: #FFF !important;
	}
	.bodys{
		width: 100%;
		padding: 40rpx;
	}
	.bodystitle{
		text-align: center;
		font-size: 30rpx;
		line-height: 44rpx;
		color: #1b1b1b;
		font-weight: 700;
		margin-bottom: 20rpx;
	}
	
	.footer-bar{
		background-color: rgba(255, 255, 255, 0.95);
		padding: 0px 20rpx;
		position: fixed;
		bottom: 0px;
		left: 0px;
		right: 0px;
		z-index: 98;
		backdrop-filter: blur(20rpx);
		display: flex;
		text-align: center;
		transition: all 250ms ease;
		height: calc(120rpx + env(safe-area-inset-bottom));
		box-shadow: 0 -10rpx 10rpx 0 rgba(0, 0, 0, 0.04);
	}
	.footer-bar.footer-bar-detached{
		border-radius: 40rpx;
		left: 20rpx !important;
		right: 20rpx !important;
		bottom: 30rpx !important;
		box-shadow: 0 0px 30rpx 0 rgba(0, 0, 0, 0.1) !important;
		height: 120rpx !important;
	}
	.fbitem{
		color: #818181;
		position: relative;
		flex: 1 1 auto;
		padding-top: 24rpx;
		
		.image{
			height: 48rpx;
			margin-top: -4rpx;
			
			image{
				width: 36rpx;
				height: 36rpx;
			}
		}
		.text{
			height: 48rpx;
			margin-top: -6rpx;
			font-size: 24rpx;
			opacity: 0.7;
			color: #818181;
		}
	}
</style>